1. Field of the Invention
This invention relates to microcomputers with embedded flash memory, and more particularly, to a microcomputer with embedded flash memory that can be reprogrammed through the microcomputer itself without having to use external programming tools. Moreover, the invention relates to a method of programming data into the embedded flash memory of the microcomputer.
2. Description of Related Art
A microcomputer is a monolithic integrated circuit with a complete microprocessor unit and an embedded flash memory unit. The entire microcomputer can be considered as a "computer on a chip", which is very compact in size and highly integrated in functionality. Unlike EEPROM (electrically erasable and programmable read-only memory), the embedded flash memory in a microcomputer can be reprogrammed without the use of ultraviolet light. Flash memory is therefore more popular than EEPROM for use as the embedded memory in microprocessors.
Conventionally, data is programmed into the embedded flash memory of a microcomputer by external programming tools and cannot be carried out directly by the microcomputer itself. Therefore, it is very inconvenient to update or change the program codes previously programmed into the embedded flash memory, in the event that bugs are found or new functions are to be added.
In some conventional designs, the microprocessor unit and the embedded flash memory in the microcomputer are separated rather than integrated on the same chip so as to allow the microcomputer to have an on-line programming capability. This design scheme, however, requires additional control circuitry and an external memory unit to implement. This makes the overall system architecture of the microcomputer more complex, considerably larger in size, and low in integration. Such a microcomputer is be more difficult and thus more costly to manufacture.
FIG. 1 is a schematic block diagram showing the basic architecture of a conventional microcomputer with embedded flash memory. As shown, the microcomputer includes a microprocessor unit 110 and a bank of embedded flash memory 130 connected via a bus 120 to the microprocessor unit 110. The embedded flash memory 130 is used to store the programs that are to be executed by the microprocessor unit 110 for specific purposes. One drawback to this microcomputer architecture, however, is that it includes only a single bank of embedded flash memory, which is insufficient if the microcomputer is to properly perform an on-chip programming process. This is because that during the on-chip programming process, the microprocessor unit 110 needs to perform both write and read operations on the embedded flash memory 130, and the provision of only one single bank of embedded flash memory does not allow the microcomputer to do this in an efficient manner.
To allow the microcomputer to have on-chip programming capability, a conventional solution is to provide an additional ROM (read-only memory) unit in the microcomputer for storing the loader program that is used to control the loading of data into the embedded flash memory. This design scheme, however, requires the fabrication of two different semiconductor memory structures, i.e., a flash memory structure and a ROM structure, and two different peripheral circuits for the flash memory and the ROM in the IC chip of the microcomputer, respectively. This makes both the design and the fabrication of the microcomputer considerably more difficult to carry out.
In conclusion, the prior art of FIG. 1 has the following drawbacks.
(1) First, since the prior art includes only one single bank of embedded flash memory, it does not allow the microcomputer to have an on-chip programming capability to program new data into the embedded flash memory. Instead, the on-chip programming process requires the use of an external programming tool, which is inconvenient and cost-ineffective, with regard to the use of the microcomputer.
(2) Second, in order to allow the microcomputer to have an on-chip programming capability, the microprocessor unit and the embedded flash memory in the microcomputer should be separated rather than integrated on the same chip and require respective peripheral circuits for proper operation. This leads to low integration, large size, and costly implementation.
(3) Third, although the on-chip programming capability can be provided by incorporating an additional ROM unit in the microcomputer for storing the loader program, it nonetheless leads to low integration, large size, and costly implementation. Moreover, both design and debugging are more difficult to carry out by the developer.